home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-03-23 | 2.6 KB | 93 lines | [TEXT/JyWs] |
- <HTML>
- <HEAD>
- <TITLE>JavaScript Scrolling Text Applet</TITLE>
-
- <SCRIPT LANGUAGE="JavaScript">
- <!-- Beginning of JavaScript Applet -------------------
- /*
- WARNING! This script example contains an error that may cause
- Netscape to crash on certain systems. Use the script with care!
-
- Copyright (C)1996 Web Integration Systems, Inc. DBA Websys, Inc.
- All Rights Reserved.
-
- This applet can be re-used or modified, if credit is given in
- the source code. We will not be held responsible for any unwanted
- effects due to the usage of this applet or any derivative.
- No warrantees for usability for any specific application are given
- or implied.
-
- Chris Skinner, January 30th, 1996.
- Hacked for CNNfn by RD, Jan. 31, 1996
- */
-
- function scrollit(seed)
- {
- var m1 = "This is an axemple of scrolling text using a JavaScript Applet";
- var m2 = " . . . you can put your own message here to get attention";
- var m3 = " . . . Please enjoy PageSpinner! ";
-
- var msg=m1+m2+m3;
- var out = " ";
- var c = 1;
-
- if (seed > 100) {
- seed--;
- var cmd="scrollit(" + seed + ")";
- timerTwo=window.setTimeout(cmd,100);
- }
- else if (seed <= 100 && seed > 0) {
- for (c=0 ; c < seed ; c++) {
- out+=" ";
- }
- out+=msg;
- seed--;
- var cmd="scrollit(" + seed + ")";
- window.status=out;
- timerTwo=window.setTimeout(cmd,100);
- }
- else if (seed <= 0) {
- if (-seed < msg.length) {
- out+=msg.substring(-seed,msg.length);
- seed--;
- var cmd="scrollit(" + seed + ")";
- window.status=out;
- timerTwo=window.setTimeout(cmd,100);
- }
- else {
- window.status=" ";
- timerTwo=window.setTimeout("scrollit(100)",75);
- }
- }
- }
- // -- End of JavaScript code -------------- -->
- </SCRIPT>
-
- </HEAD>
-
- <BODY onLoad="timerONE=window.setTimeout('scrollit(100)',500);">
-
- <H1>JavaScript Scrolling Text Applet</H1>
-
- <B>This stationary page contains a Java Applet that displays a scrolling message in the status area in Netscape Navigator 2.0. </B>
- <P>
- <FONT COLOR="DD0000">
- <PRE>WARNING! This script example contains an error that may cause
- Netscape to crash on certain systems. Use the script with care!
- </PRE>
- </FONT>
-
- The script is named <B>scrollit</B> and it is placed in the HEAD section of the HTML document. It is executed inside the BODY start tag:
-
- <XMP><BODY onLoad="timerONE=window.setTimeout('scrollit(100)',500);"></XMP>
-
- Replace the text inside the script with your own message and edit the page or copy the entire script to an existing page:
- <XMP>function scrollit(seed)
- {
- var m1 = "This is an axemple of scrolling text using a JavaScript Applet";
- var m2 = " . . . you can put your own message here to get attention";
- var m3 = " . . . Please enjoy PageSpinner! ";</XMP>
- <HR>
- </BODY>
- </HTML>
-